package com.xnyzc.lhy.common.penum.worksheet;

import com.xnyzc.lhy.common.entity.PEnum;

/**
 * 工单错误码枚举
 *
 * @Author: haoyfa
 * @Date: 2019-11-06
 */
public enum WorksheetErrorCode implements PEnum<Integer> {
    //成功标志
    success(0, "success"),
    failureOfVerification(10001, "验签失败"),
    userTookenVerification(10002, "用户token错误"),
    unKnow(403, "未知错误"),
    cancelOrderFail(415, "取消订单失败"),
    notOrderStatus(414, "没有此订单状态"),

    orderPersonalSelectFail(408, "订单查询失败"),
    serverError(10100, "失败"),
    closeOrderParamsError(500, "工单关单订单状态非法"),
    noDriverError(10200, "没有找到相关司机信息"),

    parameterError(10001, "参数错误"),
    misServerError(10001, "mis服务无法访问"),

    createWorksheetError(40001, "创建工单失败"),
    worksheetDataError(40002, "工单数据错误"),
    updateWorksheetError(41001, "更新工单状态失败"),
    getWorksheetFailed(40003,"工单查询失败"),
    createWorksheetFailed(40004, "查询工单失败"),
    getDriverFailed(40005, "司机处罚操作失败"),
    driverPenaltyFailed(40006, "司机处罚操作失败"),
    getRoleFailed(40007, "获取角色失败"),
    createWorksheetOperateFailed(50001, "创建工单操作记录失败"),
    updateWorksheetOperateFailed(50002, "更新工单操作记录失败"),
    noWalletWorksheetOperateFailed(60001, "司机钱包不存在，请确认");

    int value;
    String desc;

    WorksheetErrorCode(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public String getDesc() {
        return desc;
    }

    @Override
    public Integer getValue() {
        return value;
    }

    @Override
    public String toString() {
        return name();
    }

    @Override
    public String toChString() {
        return desc;
    }

    public String toMessage() {
        String errorMessage = this.value + "," + this.desc;
        return errorMessage;
    }
}
